package com.cleaningcloud.cld.service.impl;

import java.util.List;
import com.cleaningcloud.common.core.utils.DateUtils;
import com.cleaningcloud.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cleaningcloud.cld.mapper.CldWelfareMapper;
import com.cleaningcloud.cld.domain.CldWelfare;
import com.cleaningcloud.cld.service.ICldWelfareService;

/**
 * 福利津贴Service业务层处理
 * 
 * @author cleaningcloud
 * @date 2024-11-08
 */
@Service
public class CldWelfareServiceImpl implements ICldWelfareService 
{
    @Autowired
    private CldWelfareMapper cldWelfareMapper;

    /**
     * 查询福利津贴
     * 
     * @param walfareId 福利津贴主键
     * @return 福利津贴
     */
    @Override
    public CldWelfare selectCldWelfareByWalfareId(Long walfareId)
    {
        return cldWelfareMapper.selectCldWelfareByWalfareId(walfareId);
    }

    /**
     * 查询福利津贴列表
     * 
     * @param cldWelfare 福利津贴
     * @return 福利津贴
     */
    @Override
    public List<CldWelfare> selectCldWelfareList(CldWelfare cldWelfare)
    {
        return cldWelfareMapper.selectCldWelfareList(cldWelfare);
    }

    /**
     * 新增福利津贴
     * 
     * @param cldWelfare 福利津贴
     * @return 结果
     */
    @Override
    public int insertCldWelfare(CldWelfare cldWelfare)
    {
        cldWelfare.setCreateTime(DateUtils.getNowDate());
        cldWelfare.setCreateName(SecurityUtils.getUsername());
        cldWelfare.setCreateId(SecurityUtils.getUserId());
        cldWelfare.setFlag(0L);
        return cldWelfareMapper.insertCldWelfare(cldWelfare);
    }

    /**
     * 修改福利津贴
     * 
     * @param cldWelfare 福利津贴
     * @return 结果
     */
    @Override
    public int updateCldWelfare(CldWelfare cldWelfare)
    {
        return cldWelfareMapper.updateCldWelfare(cldWelfare);
    }

    /**
     * 批量删除福利津贴
     * 
     * @param walfareIds 需要删除的福利津贴主键
     * @return 结果
     */
    @Override
    public int deleteCldWelfareByWalfareIds(Long[] walfareIds)
    {
        return cldWelfareMapper.deleteCldWelfareByWalfareIds(walfareIds);
    }

    /**
     * 删除福利津贴信息
     * 
     * @param walfareId 福利津贴主键
     * @return 结果
     */
    @Override
    public int deleteCldWelfareByWalfareId(Long walfareId)
    {
        return cldWelfareMapper.deleteCldWelfareByWalfareId(walfareId);
    }
}
